#pragma once
#include "resource.h"
#include "EXDialogResSet.h"
// CEXDialog dialog

class AFX_EXT_CLASS CEXDialog : public CDialog
{
	DECLARE_DYNAMIC(CEXDialog)

public:
  enum DIALOG_STYLE
  {
    NOIMAGE,
    DIALOG_CTRL = 24,
  };
  CEXDialog();
  CEXDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL);
  CEXDialog(UINT nIDTemplate, CWnd* pParentWnd = NULL);
	virtual ~CEXDialog();

  void InitBitmap(CEXDialogResSet* pResSet);
  void DrawDialog(CDialog * pDlg, CDC * pDC);
  void SetDialogRegion(CWnd * pDlg);
  void GetRegion(CWnd * pWnd, CRgn & rgn, CBitmap * pbmpSource, 
                int nOffsetX, int nOffsetY);

  void DrawGroupBox(CWnd * pParentWnd, CWnd * pGroupBox, CDC * pDC);
  void SetResSet(CEXBaseResSet *pResSet);
  void SetCaption(CString strCaption);
  COLORREF GetBKColor()   {return m_crBkgnd;};
  COLORREF GetTextColor() {return m_crText;};
  CFont* GetDlgFont()     {return m_pftText;};
protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support



	DECLARE_MESSAGE_MAP()
private:
  CBitmap m_bmpDlgT;
  CBitmap m_bmpDlgB;
  CBitmap m_bmpDlgL;
  CBitmap m_bmpDlgR;
  CBitmap m_bmpDlgLT;
  CBitmap m_bmpDlgLB;
  CBitmap m_bmpDlgRT;
  CBitmap m_bmpDlgRB;

  BITMAP m_bmDlgT;
  BITMAP m_bmDlgB;
  BITMAP m_bmDlgL;
  BITMAP m_bmDlgR;
  BITMAP m_bmDlgLT;
  BITMAP m_bmDlgLB;
  BITMAP m_bmDlgRT;
  BITMAP m_bmDlgRB;
  
  COLORREF m_crCaption;
  COLORREF m_crBkgnd;
  COLORREF m_crText;

  CFont *m_pftText;
  CRect m_rtDlg;
  BOOL m_bImg;
  CString m_strCaption;
  CEXDialogResSet *m_pDialogResSet;
public:
  afx_msg LRESULT OnNcHitTest(CPoint point);
};
